wayland: Make toplevels' X/Y coordinates be 0
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 21 Aug 2014 15:39:09 +0000 (17:39 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Tue, 26 Aug 2014 10:58:13 +0000 (12:58 +0200)
To all effects each window has its own "root" coordinates system, so set
toplevels at 0,0 in that coordinate system, so root coordinate calculations
are locally right.

https://bugzilla.gnome.org/show_bug.cgi?id=729215

gdk/wayland/gdkwindow-wayland.c

index f26c3e0c3a56b9d94815ee46c67e49d846ccfcd2..055352227e7242b46b2496e50a91ebb48f28e552 100644 (file)
@@ -1205,8 +1205,12 @@ gdk_window_wayland_move_resize (GdkWindow *window,
 {
   if (with_move)
     {
-      window->x = x;
-      window->y = y;
+      /* Each toplevel has in its own "root" coordinate system */
+      if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_TOPLEVEL)
+        {
+          window->x = x;
+          window->y = y;
+        }
     }
 
   /* If this function is called with width and height = -1 then that means